package com.lanfan.controller.admin;
import com.lanfan.entity.ResponseResult;

import com.lanfan.utils.OSSUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
public class UploadController {

    @Resource
    private OSSUtil ossUtil;

    @RequestMapping("/upload")
    public ResponseResult upload(MultipartFile file) {
        String upload=ossUtil.upload(file);
        ResponseResult responseResult=new ResponseResult<>();
        responseResult.setDate(upload);
        return responseResult;
    }
}